<?php
session_start();
require 'vendor/autoload.php';

#定义一个自动处理异常的类
class Boots{
    public function boot(){
        set_exception_handler([$this,'exception']);
    }

    public function exception($e){
        if(method_exists($e,'render')){
            $e->render();
        }else{
            die($e);
        }
    }
}
(new Boots())->boot();